<?php
if(!defined('INDEX')){
	exit('Access Denied');
}
$parameter=act_user_favorite();
extract($parameter);

$css[]=TPLURL."/goods/250/css/list.css";
include(TPLPATH.'/inc/header.tpl.php');
?>
<script type="text/javascript" src="js/scrollpagination.js"></script>
<script>
$(function(){
	$('.my-del').click(function(){
		var t = $(this);
		var data_id=$(this).attr('data_id');
		$.ajax({
			url: "<?=u(MOD,ACT,array('del'=>1))?>",
			data:{id:data_id},
			dataType:'jsonp',
			jsonp:"callback",
			success: function(data){
				if(data.s==0){
					alert('数据错误，请刷新页面');
				}
				else if(data.s==1){ 
					window.location='<?=u(MOD,ACT)?>';
				}
			 }
		});
	});
});
</script>
<div style="width:100%;height:45px; line-height:45px;background:#fff;">
         <div style="margin:0 auto; width:1197px;  font-size:16px; font-family:"微软雅黑"">
      	<div style="float:right;"><b>已经收藏了 <font color="#FF0000"><?=$total?></font> 件宝贝</b></div>
        <div style="width:390px; float:left;">
          <a onclick="confirm('确定清空所有记录？');window.location='<?=u(MOD,ACT)?>&del=1';" style="cursor: pointer;">全部清空</a> 
        </div></div>
        <div style="clear:both;"></div></div>

<div style=" height:0px; overflow:hidden">&nbsp;</div>
<div class="goods_list">
 <div style="padding-top:10px;">
<div class="goods_list_315">
<!--这里必须定义一个goods_items-->
<ul class="goods_items">
<?php if(!empty($fav)){?>
<?php foreach($fav as $row){?>
<?php if($dd_tpl_data['fanli-kg']['open']==0){?>
<li class="gm" <?php if($m%4==0){?> style="margin-left:0px; height:400px; "<?php }?>>
<?php }else{?>
<li class="gm" <?php if($m%4==0){?> style="margin-left:0px; height:370px; "<?php }?>>
<?php }?>
<div class="list-good">
<div class="left">
<a class="click_url" dd-href="?mod=jump&act=s8&iid=<?=iid_encode($row['data_id'])?>&url=" data-itemid="<?=$row['data_id']?>" isconvert=1 href="<?=$row['url']?>" target="_blank"><?=dd_html_img($row['img'],$row['title'],310)?>
<?php if($row['price_man']>0){?>
<div class="lingquan"><a href="<?=$row['lq_url']?$row['lq_url']:'javascript:void(0)'?>" target="_blank" rel="nofollow"><span>领券省<br><em><?=$row['price_jian']?>元</em></span><b></b></a></div>
 <?php }?>
<?php if($row['top']>0){?><span class="tuijian"></span><?php }?>
<?php if($row['is_starttime']){?>
<span class="yugao2"></span>
<?php }else{?>
<?php if($row['is_new']){?><span class="new-icon"></span><?php }?>
<?php }?>
<?php if($row['is_starttime']){?>
<?php }elseif($row['oversell']==1){?>
<div class="yimaiguang"></div>
<?php }elseif($row['is_endtime']){?>
<div class="end_time" title="于<?=$row['endtime']?>结束"></div>
<?php }?>
</a>
<div class="tp_ab">
	
    <?php if($row['shouji_price']>0 && $row['shouji_price']<$row['discount_price']){?>
    <div class="tp_bq tp_2 erweima dd_cure"  id="<?=$row['id']?>&uid=<?=$dduser['id']?>" url="<?=$row['url']?>" youhui="<?=$row['discount_price']-$row['shouji_price']?>">
    	<div class="inline" style="color:#fff;">
            <span>手机买再省</span><br />
            <b class="span_1"><?=$row['discount_price']-$row['shouji_price']?>元</b>
        </div>
    </div>
    <?php }?>
    <?php if($row['is_fanli_ico']){?>
    <div class="tp_bq tp_3">
        <span>超级返利</span>
    </div>
    <?php }?>
</div>
<?php if($row['top']>0){?><div class="n_top"></div><?php }?>
</div>
<?php if($row['opca']){?>
<div class="opca"></div>
<?php }?>
<a class="click_url" dd-href="?mod=jump&act=s8&iid=<?=iid_encode($row['data_id'])?>&url=" data-itemid="<?=$row['data_id']?>" isconvert=1 href="<?=$row['url']?>" target="_blank"> <div class="jy_title">[包邮] <?=$row['title']?></div></a>
<div class="jy_nr">
<div class="jy_price">
	<div class="inblock">
	<?php if($row['is_starttime']){?>
<font color="#008800">¥</font><span><font color="#008800"><?php if($row['laiyuan_type']==3){?><?=number_format($row['discount_price'])?><?php }else{?><?=number_format($row['discount_price'],2)?><?php }?></font></span>
<?php }else{?>
¥<span><?php if($row['laiyuan_type']==3){?><?=number_format($row['discount_price'])?><?php }else{?><?=number_format($row['discount_price'],2)?><?php }?></span>

<?php }?>
    </div>
    <div class="inblock2">
			<div style="width:80px"> <span class="dazhe"><del>￥<?=$row['price']?></del></span></div>
    </div></div>
	<?php if($dd_tpl_data['fanli-kg']['open']==0){?>
<?php }else{?>
	<div class="jy_del">
 <div class="inblock guan" style="float:right; margin-right:10px">
	<div class="jy_w_buy" style=" margin-top:-33px;*margin-top:-26px;">
	<?php if($row['laiyuan_type']==1){?><div title="淘宝" class="tb"><i></i></div><?php }?>
            <?php if($row['laiyuan_type']==2){?><div title="天猫" class="tmall"><i></i></div><?php }?>
            <?php if($row['laiyuan_type']==3){?><div title="京东商城" class="jd"><i></i></div><?php }?>
            <?php if($row['laiyuan_type']==4){?><div title="拍拍" class="paipai"><i></i></div><?php }?>
			  </div>  </div>
			  </div>  
<?php }?>
   <div class="inblock guan" style="float:right; margin-right:10px">
    
    	<div class="jy_w_buy" style=" margin-top:-33px;*margin-top:-25px;">
			<?php if($row['is_starttime']){?>
<div class="yishou2"><?=$row['starttime_tag']?>开始</div>
<?php }else{?>

<?php if($row['sell']){?>   <div class="yishou">已售<?=$row['sell']?>件</div> <?php }?>

<?php }?>
        </div>
    </div>
<?php if($dd_tpl_data['fanli-kg']['open']==0){?>
<div class="jy_del">
<?php if(FANLI==1&&$row['fanli']){?> <div class="f_money"><span class="fuhao" style="padding-top:5px">返</span><span class="f_num"><?=$row['fanli_je']?></span><span class="f_word">到手价<?php
$a=$row['discount_price'];
$b=$row['fanli_je'];
$fanliba=$a-$b;
echo $fanliba;
?></span></div><?php }else{?><div class="yfl">有返利</div><?php if($row['price_man']>0){?><div class="yhq">满就送</div> <?php }?>
                    <?php }?>

 <div class="inblock guan" style="float:right; margin-right:10px">
	<div class="jy_w_buy" style=" margin-top:-4px;*margin-top:-4px;">
	<?php if($row['laiyuan_type']==1){?><div title="淘宝" class="tb"><i></i></div><?php }?>
            <?php if($row['laiyuan_type']==2){?><div title="天猫" class="tmall"><i></i></div><?php }?>
            <?php if($row['laiyuan_type']==3){?><div title="京东商城" class="jd"><i></i></div><?php }?>
            <?php if($row['laiyuan_type']==4){?><div title="拍拍" class="paipai"><i></i></div><?php }?>
			  </div>  </div>
			  </div>  <?php }?>
</div>
<a class="y-like my-del" title="删除该收藏商品" data_id="<?=$row['id']?>">
   <span class="del-ico"></span>
</a>
 
   
</div>
 <a class="tejia click_url c_bgcolor" dd-href="?mod=jump&act=s8&iid=<?=iid_encode($row['data_id'])?>&url=" data-itemid="<?=$row['data_id']?>" isconvert=1 href="<?=$row['jump']?>" isconvert=1 title="去淘宝购买" target="_blank">去抢购</a>

</li>
<?php }?>
<?php }else{?>
       	<div class="empty_data">
          <div class="empty_ico">&nbsp;</div>
          <div class="empty_word">抱歉，没有找到相关商品。</div>
		  <div style="clear:both"></div>
        </div>
        <?php }?>
</ul>
<div style="clear:both"></div>
</div></div>
</div>
<div style="clear:both;"></div>
<div id="ajax_goods_loading" style="margin-bottom:10px"><img src="<?=TPLURL?>/inc/images/white-ajax-loader.gif" style="margin-bottom:-2px" alt="加载商品" />&nbsp;&nbsp;正在加载商品</div>
<div class="megas512" style="padding:10px;">
  <?=pageft($total,$pagesize,u(MOD,ACT))?>
</div>
<?php include(TPLPATH.'/goods/jumpbox.tpl.php');?>
<script type="text/javascript">
scrollPaginationPage=(<?=$ajax_load_num?>-1)*<?=($page-1)?>+1;
$(function(){
	LazyLoad($('.list-good'));
})
</script>
<?php include(TPLPATH.'/inc/tdj.tpl.php');?>
<?php 
include(TPLPATH."/inc/footer.tpl.php");
?>